﻿using System;
using System.Runtime.InteropServices;

namespace VSCodeLineCounter
{
	public static class NativeMethods
	{
		[StructLayout(LayoutKind.Sequential)]
		public struct SHFILEINFO
		{
			public IntPtr hIcon;
			public int iIcon;
			public uint dwAttributes;
			[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
			public string szDisplayName;
			[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
			public string szTypeName;
		};

		public static class FILE_ATTRIBUTE
		{
			public const uint FILE_ATTRIBUTE_NORMAL = 0x80;
		}

		public static class SHGFI
		{
			public const uint SHGFI_TYPENAME = 0x000000400;
			public const uint SHGFI_USEFILEATTRIBUTES = 0x000000010;
		}

		[DllImport("shell32.dll")]
		public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
	}
}
